//-----------------------------------------------------------------------------
// File: FallbackChain.cs
//
// Copyright (c) Dmitry Shuklin. All rights reserved.
//-----------------------------------------------------------------------------
using System;

namespace ObjectiveDraw.Platform.Serialization
{
	/// <summary>
	/// Summary description for FallbackChain.
	/// </summary>
	public class FallbackChain
	{
		private FallbackChain m_Precedent;
		public FallbackChain Precedent
		{
			get
			{
				return m_Precedent;
			}
		}
		private Cerebrum.IContainer m_Container;
		public Cerebrum.IContainer Container
		{
			get
			{
				return m_Container;
			}
		}

		public FallbackChain(FallbackChain precedent, Cerebrum.IContainer container)
		{
			this.m_Precedent = precedent;
			this.m_Container = container;
		}

		public FallbackChain(Cerebrum.IContainer container)
		{
			this.m_Precedent = null;
			this.m_Container = container;
		}

		public virtual FallbackChain CreateDependent(Cerebrum.IContainer container)
		{
			return new FallbackChain(this, container);
		}
	}
}
